
% Objective-C Foundation Reference Card (part 1)
% Copyright (c) 2003-2005 Dick van Oudheusden
% TeX Format

% Uncomment the following line for dvi/ps generation: tex ofc-refcard1.tex; dvips -o ofc-refcard1.ps ofc-refcard1.dvi
%\input outopt.tex

% Uncomment the following three lines for PDF generation: pdftex ofc-refcard1.tex
\pdfoutput=1
\pdfpageheight=21cm
\pdfpagewidth=29.7cm

% Font definitions
\font\bigbf=cmb12
\font\smallbf=cmb10
\font\smallrm=cmr8
\font\smalltt=cmtt8
\font\smallit=cmmi8
\font\tinyit=cmmi5

\def\cm#1#2{{\smalltt#1}\dotfill{\smallrm#2}\par}
\def\cl#1#2{\hskip 12pt$\lfloor${\smalltt#1}\dotfill{\smallrm#2}\par}
\def\cn#1{\hfill$\lfloor$ {\smallrm#1}\par}
\def\sect#1{\vskip 0.7cm \hfil{\smallbf#1}\hfil\par}
\def\para#1{{\smallit#1}\par}
\def\vsep{\vskip 6pt}

% Characters definitions
\def\bs{$\backslash$}
\def\backspace{$\leftarrow$}
\def\ctrl{{\rm\char94}\kern-1pt}
\def\enter{$\hookleftarrow$}
\def\or{\thinspace{\tinyit{or}}\thinspace}
\def\key#1{$\langle${\rm{\it#1}}$\rangle$}
\def\rapos{\char125}
\def\lapos{\char123}
\def\bs{\char92}
\def\tild{\char126}

% Three columns definitions
\parindent 0pt
%\nopagenumbers
\hoffset=-1.56cm
\voffset=-1.54cm
\newdimen\fullhsize
\fullhsize=27.9cm
\hsize=8.5cm
\vsize=19cm
\def\fullline{\hbox to\fullhsize}
\let\lr=L
\newbox\leftcolumn
\newbox\midcolumn
\output={
  \if L\lr
    \global\setbox\leftcolumn=\columnbox
    \global\let\lr=M
  \else\if M\lr
    \global\setbox\midcolumn=\columnbox
    \global\let\lr=R
  \else
    \tripleformat
    \global\let\lr=L
  \fi\fi
  \ifnum\outputpenalty>-20000
  \else
    \dosupereject
  \fi}
\def\tripleformat{
  \shipout\vbox{\fullline{\box\leftcolumn\hfil\box\midcolumn\hfil\columnbox}}
  \advancepageno}
\def\columnbox{\leftline{\pagebody}}

% Card content
% Header
%\hrule\vskip 3pt
\hfil{\bf OBJECTIVE-C FOUNDATION CLASSES}\hfil\par
\hfil{\bf REFERENCE CARD}\hfil\par
\hfil{\bf Part 1: Datatypes}\hfil\par
\vskip 2pt\hrule

\sect{DBigInt}
\para{Methods}
\cm{- init}{Init to number 0}
\cm{- init :(long) number}{Init to small number}
\cm{- init :(char *) cstring :(int) base}{Init with string}
\cm{- deepen}{Deepen the copied object}
\cm{- free}{Free the big integer}
\cm{- (BOOL) isNegative}{Check for a negative number}
\cm{- (BOOL) isZero}{Check for number 0}
\cm{- clear}{Set big integer to 0}
\cm{- set :(long) number}{Set to small number}
\cm{- set :(uchar *) number :(ulong) length :(BOOL) negative}{}
\cn{Set with array of bytes}
\cm{- (BOOL) set :(const char *) cstring :(int) base}{}
\cn{Set with a cstring}
\cm{- move :(DBigInt *) other}{Set with other big integer}
\cm{- (long) get}{Get as small number}
\cm{- (DText *) get :(int) base}{Get as text string}
\cm{- (DData *) toData}{Get as data string}
\cm{- add :(DBigInt *) other}{Add with another big integer}
\cm{- add :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Add two big integers}
\cm{- sub :(DBigInt *) other}{Subtract with another big integer}
\cm{- sub :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Subtract two big integers}
\cm{- mul :(DBigInt *) other}{Multiply with another big integer}
\cm{- mul :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Multiply two big integers}
\cm{- div :(DBigInt *) other}{Divide with another big integer}
\cm{- div :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Divide two big integers}
\cm{- mod :(DBigInt *) other }{Modulo with another big integer}
\cm{- mod :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Modulo two big integers}
\cm{- abs}{Absolute the big integer}
\cm{- com}{One complements the big integer}
\cm{- negate}{Negate the big integer}
\cm{- and :(DBigInt *) other}{And with another big integer}
\cm{- and :(DBigInt *) src1 :(DBigInt *) src2}{And two big integers}
\cm{- or :(DBigInt *) other}{Or with another big integer}
\cm{- or :(DBigInt *) src1 :(DBigInt *) src2}{Or two big integers}
\cm{- xor :(DBigInt *) other}{Xor with another big integer}
\cm{- xor :(DBigInt *) src1 :(DBigInt *) src2}{}
\cn{Xor two bit integers}
\cm{- lshift :(ulong) shifts}{Left shift the big integer}
\cm{- lshift :(DBigInt *) src :(ulong) shifts}{}
\cn{Left shift the source}
\cm{- rshift :(ulong) shifts}{Right shift the big integer}
\cm{- rshift :(DBigInt *) src :(ulong) shifts}{}
\cn{Right shift the source}
\cm{- (int) compare :(DBigInt *) other}{}
\cn{Compare with another big integer}
\cm{- (DText *) toText}{Convert to a decimal text string}
\cm{- (int) fromString :(char **) cstr}{}
\cn{Parse a cstring for a big integer}

\sect{DBitArray}
\para{Methods}
\cm{- init}{Init default bit array [0..255]}
\cm{- init :(int) min :(int) max}{Init bit array [min..max]}
\cm{- copy}{Copy the bit array}
\cm{- free}{Free the bit array}
\cm{- (int) min}{Return the minimum value in the array}
\cm{- (int) max}{Return the maximum value in the array}
\cm{- reset}{Reset all values in bit array}
\cm{- set :(int) val}{Set a value in array}
\cm{- reset :(int) val}{Reset a value in array}
\cm{- set :(int) from :(int) to}{Set from..to in array}
\cm{- reset :(int) from :(int) to}{Reset from..to in array}
\cm{- set :(int) from :(int) to :(unsigned) step}{}
\cn{Set from..to in steps in array}
\cm{- reset :(int) from :(int) to :(unsigned) step}{}
\cn{Reset from..to in steps in array}
\cm{- (BOOL) has :(int) val}{Test if value is set in array}
\cm{- (int) count}{Count number values set in array}

\sect{DBool}
\para{Methods}
\cm{- init}{Init to false}
\cm{- init :(BOOL) state}{Init to state}
\cm{- (BOOL) get}{Get the state}
\cm{- set :(BOOL) state}{Set the state}
\cm{- (int) compare :(DBool *) other}{}
\cn{Compare two bool objects}
\cm{- (int) fromString :(char **) cstr}{}
\cn{Parse a string for a boolean state}
\cm{- (DText *) toText}{Convert to text string}
\cm{- (DData *) toData}{Convert to data string}

\sect{DColor}
\para{Constants}
\cm{DCLR\_BLACK}{Black text color}
\cm{DCLR\_RED}{Red text color}
\cm{DCLR\_GREEN}{Green text color}
\cm{DCLR\_YELLOW}{Yellow text color}
\cm{DCLR\_BLUE}{Blue text color}
\cm{DCLR\_MAGENTA}{Magenta text color}
\cm{DCLR\_CYAN}{Cyan text color}
\cm{DCLR\_WHITE}{White text color}
\para{Public members}
\cm{unsigned char \_red}{the red factor}
\cm{unsigned char \_green}{the green factor}
\cm{unsigned char \_blue}{the blue factor}
\cm{unsigned char \_alpha}{the alpha factor}
\cm{int           \_text}{the text color}
\para{Methods}
\cm{- init}{Init to solid black color}
\cm{- init :(char *) name}{Init to named color}
\cm{- init :(uchar) red :(uchar) blue :(uchar) green}{}
\cn{Init to solid rgb color}
\cm{- init :(uchar) red :(uchar) blue :(uchar) green}{}
\cl{:(uchar) alpha}{Init to transparent rgb color}
\cm{- (uchar) red}{Return the red factor}
\cm{- (uchar) green}{Return the green factor}
\cm{- (uchar) blue}{Return the blue factor}
\cm{- (uchar) alpha}{Return the alpha factor}
\cm{- alpha :(uchar) alpha}{Set the alpha factor}
\cm{- (int) textColor}{Return the text color}
\cm{- textColor :(int) color}{Set the text color}
\cm{- (BOOL) set :(char *) name}{Set to a named color}
\cm{- set :(uchar) red :(uchar) green :(uchar) blue}{}
\cn{Set to a rgb color}
\cm{- set :(uchar) red :(uchar) green :(uchar) blue}{}
\cl{:(uchar) alpha}{Set to a transparent rgb color}
\cm{- set :(uchar) red :(uchar) green :(uchar) blue}{}
\cl{:(uchar) alpha :(int) color}{Set all color fields}
\cm{- lighter :(double) factor}{Make color lighter or darker}
\cm{- blend :(uchar) red :(uchar) green :(uchar) blue}{}
\cl{:(uchar) alpha}{Alpha blend with second color}
\cm{- toRGB :(double *) red :(double *) green}{}
\cl{:(double *) blue}{Convert object to RGB color}
\cm{- fromRGB :(double) red :(double) green :(double) blue}{}
\cn{Set object with RGB color}
\cm{- toYIQ :(double *) Y :(double *) I :(double *) Q}{}
\cn{Convert object ot YIQ color}
\cm{- fromYIQ :(double) Y :(double) I :(double) Q}{}
\cn{Set object with YIQ color}
\cm{- toHLS :(double *) H :(double *) L :(double *) S}{}
\cn{Convert object to HLS color}
\cm{- fromHLS :(double) H :(double) L :(double) S}{}
\cn{Set object with HLS color}
\cm{- toHSV :(double *) H :(double *) S :(double *) V}{}
\cn{Convert object to HSV color}
\cm{- fromHSV :(double) H :(double) S :(double) V}{}
\cn{Set object with HSV color}
\cm{- toCMY :(double *) C :(double *) M :(double *) Y}{}
\cn{Convert object to CMY color}
\cm{- fromCMY :(double) C :(double) M :(double) Y}{}
\cn{Set object with CMY color}
\cm{- (DText *) toText}{Convert object to a text object}
\cm{- (int) fromString :(char **) cstr}{Parse string for color}

\sect{DComplex}
\para{Methods}
\cm{- init}{Init to complex number zero}
\cm{- init :(double) re :(double) im}{Init complex number}
\cm{- (double) re}{Return real part}
\cm{- re :(double) re}{Set read part}
\cm{- (double) im}{Return imaginary part}
\cm{- im :(double) im}{Set imaginary part}
\cm{- set :(double) re :(double) im}{Set real and imaginary part}
\cm{- move :(DComplex *) other}{Assign complex number from other}
\cm{- add :(DComplex *) other}{Add with complex number}
\cm{- add :(DComplex *) s1 :(DComplex *) s2}{}
\cn{Add two complex numbers}
\cm{- sub :(DComplex *) other}{Subract with complex number}
\cm{- sub :(DComplex *) s1 :(DComplex *) s2}{}
\cn{Subract two complex number}
\cm{- mul :(DComplex *) other}{Multiply with complex number}
\cm{- mul :(DComplex *) s1 :(DComplex *) s2}{}
\cn{Multiply two complex numbers}
\cm{- rmul :(double) re}{Multiply complex with real number}
\cm{- imul :(double) im}{Multiply complex with imaginary number}
\cm{- div :(DComplex *) other}{Divide with complex number}
\cm{- div :(DComplex *) s1 :(DComplex *) s2}{}
\cn{Divide two complex numbers}
\cm{- cng }{Conjugate}
\cm{- (double) abs}{Modulus}
\cm{- (double) nrm}{Square modulus}
\cm{- sqrt}{Square root}
\cm{- exp}{Exponent}
\cm{- log}{Natural logarithm}
\cm{- sin}{Trigonometric sine}
\cm{- cos}{Trigonometric consine}
\cm{- tan}{Trigonometric trangent}
\cm{- asin}{Inverse trigonometric sine}
\cm{- acos}{Inverse trigonometric cosine}
\cm{- atan}{Inverse trigonometric trangent}
\cm{- sinh}{Hyperbolic sine}
\cm{- cosh}{Hyperbolic cosine}
\cm{- tanh}{Hyperbolic tangent}
\cm{- asinh}{Inverse hyperbolic sine}
\cm{- acosh}{Inverse hyperbolic cosine}
\cm{- atanh}{Inverse hyperbolic tangent}
\cm{- (DText *) toText}{Convert complex number to (new)}
\cn{text string}

\sect{DData}
\para{Methods}
\cm{- init}{Init empty data string}
\cm{- init :(uchar *) data :(ulong) len}{Init string with data}
\cm{- copy}{Copy data string}
\cm{- free}{Free the data string}
\cm{- size :(ulong) size}{Insure the size of data string}
\cm{- extra :(unsigned) extra}{Set extra size during resizing}
\cm{- (DText *) tohexString}{Convert to new hex text string}
\cm{- (ulong) hash}{Calculate hash from data string}
\cm{- (DText *) toText}{Convert to text object}
\cm{- (DText *) toBase64}{Convert to base64}
\cm{- (DText *) toPrintable}{Convert to printable text object}
\cm{- clear}{Clear the data string}
\cm{- set :(uchar *) data :(ulong) len}{Set with data}
\cm{- set :(uchar *) data :(long) from :(long) to}{}
\cn{Set with substring of data}
\cm{- fromBase64 :(char *) cstring}{Convert from base64}
\cm{- put :(long) index :(uchar) byte}{Set byte in data string}
\cm{- (uchar) get :(long) index}{Get byte from data string}
\cm{- delete :(long) index}{Remove byte from data string}
\cm{- insert :(long)fr :(long)to :(uchar*)data :(ulong)len}{}
\cn{Insert data in part of data string}
\cm{- (DData *) get :(long) from :(long) to}{}
\cn{Return new sub data string}
\cm{- delete :(long) from :(long) to}{}
\cn{Delete part of data string}
\cm{- (BOOL) isEmpty}{Test for empty data string}
\cm{- (ulong) length}{Return length of data string}
\cm{- (uchar *) data}{Return pointer to data string}
\cm{- (ulong) size}{Return the size of the data string}
\cm{- (int) error}{Return the current error (or 0)}
\cm{- (DData *) toData}{Convert data to new DData object}
\cm{- (DText *) readText :(ulong) len}{}
\cn{Read length text from data string}
\cm{- (DData *) readData :(ulong) len}{}
\cn{Read length data from data string}
\cm{- (char) readChar}{Read character from data string}
\cm{- (uchar) readByte}{Read byte from data string}
\cm{- (short) readShort}{Read short from data string}
\cm{- (long) readLong}{Read long from data string}
\cm{- (double) readDouble}{Read double from data string}
\cm{- (BOOL) isEof}{Test for end position in string}
\cm{- (DText *) scanText :(char) sep}{Scan text until separator}
\cm{- (BOOL) cmatch :(char *) cstr}{Match with string, case sens.}
\cm{- (BOOL) imatch :(char *) cstr}{Match with string, case insens.}
\cm{- (int) scanInt :(int) wrong}{Scan text for int}
\cm{- (int) skipChar :(char) ch}{Skip character}
\cm{- (int) skipWhiteSpace}{Skip whitespace}
\cm{- (BOOL) writeText :(char *) text}{Write text in data string}
\cm{- (BOOL) writeData :(uchar *) text :(ulong) len}{}
\cn{Write data in data string}
\cm{- (BOOL) writeChar :(char) ch}{Write character in data string}
\cm{- (BOOL) writeByte :(uchar) byte}{Write byte in data string}
\cm{- (BOOL) writeShort :(short) sh}{Write short in data string}
\cm{- (BOOL) writeLong :(long) sh}{Write long in data string}
\cm{- (BOOL) writeDouble :(double) sh}{Write double in string}
\cm{- (ulong) tell}{Return current position in data string}
\cm{- seek :(ulong) off :(int) origin}{}
\cn{Move position in data string}
\cm{- skip :(ulong) off}{Skip position in data string}
\cm{- append :(uchar *) data :(ulong) len}{Append data to string}
\cm{- prepend :(uchar *) data :(ulong) len}{}
\cn{Prepend data to string}
\cm{- push :(uchar) ch}{Push a byte behind the data string}
\cm{- (uchar) pop}{Pull a byte from the data string}
\cm{- multiply :(unsigned) times}{Repeat the data in the string}
\cm{- (int) compare :(DData *) obj}{Compare data string with obj}
\cm{- (int) bcompare :(uchar *) data :(ulong) len}{}
\cn{Binairy compare data string with data (-1,0,1)}
\cm{- (ulong) count :(uchar *)srch :(ulong) len :(long) from}{}
\cl{:(long) to}{Count 'srch' occurences in data string}
\cm{- (long) index  :(uchar *) srch :(ulong) len :(long) from}{}
\cl{:(long) to}{Return first index where 'srch' is found}
\cm{- (long) rindex :(uchar*) srch :(ulong) len :(long) from}{}
\cl{:(long) to}{Return last index where 'srch' is found}
\cm{- replace :(uchar*) old :(ulong) olen :(uchar*) new}{}
\cl{:(ulong) nlen :(long) max}{}
\cn{Replace old with new in data string, max times}

\sect{DDateTime}
\para{Constants}
\cm{DDT\_SUNDAY}{Weekday sunday}
\cm{DDT\_MONDAY}{Weekday monday}
\cm{DDT\_TUESDAY}{Weekday tuesday}
\cm{DDT\_WEDNESDAY}{Weekday wednesday}
\cm{DDT\_THURSDAY}{Weekday thursday}
\cm{DDT\_FRIDAY}{Weekday friday}
\cm{DDT\_SATURDAY}{Weekday saturday}
\cm{DDT\_MIN\_YEAR}{Minimum value for year}
\para{Class Methods}
\cm{+ (BOOL) isLeapYear :(int) year}{Check for leap year}
\cm{+ (int) daysInMonth :(int) year :(int) month}{}
\cn{Return number of days in month}
\cm{+ (BOOL) isDateValid :(int) year :(int) month :(int) day}{}
\cn{Check if date is valid}
\cm{+ (BOOL) isTimeValid :(int) hours :(int) minutes}{}
\cl{ :(int) seconds :(int) millis}{Check if time is valid}
\cm{+ (BOOL) isValid :(int) year :(int) month :(int) day}{}
\cl{:(int) hours :(int) minutes :(int) seconds}{}
\cl{ :(int) millis}{Check if date and time is valid}
\para{Object Methods}
\cm{- init}{Init empty date/time}
\cm{- init :(int) year :(int) month :(int) day}{}
\cl{:(int) hours :(int) minutes :(int) seconds}{}
\cn{Init with date/time}
\cm{- copy}{Copy the object}
\cm{- (int) year}{Return year}
\cm{- (int) month}{Return month}
\cm{- (int) day}{Return day}
\cm{- (int) hours}{Return hours}
\cm{- (int) minutes}{Return minutes}
\cm{- (int) seconds}{Return seconds}
\cm{- (int) millis}{Return milliseconds}
\cm{- (int) weekday}{Return the day of the week}
\cm{- (BOOL) set :(int) year :(int) month :(int) day}{}
\cl{:(int) hours :(int) minutes :(int) seconds}{}
\cn{Set the date/time}
\cm{- (BOOL) set :(int) year :(int) month :(int) day}{}
\cl{:(int) hours :(int) minutes :(int) seconds}{}
\cl{ :(int) millis}{Set date/time with milliseconds}
\cm{- (BOOL) time :(int) hours :(int) minutes :(int) seconds}{}
\cn{Set the time}
\cm{- (BOOL) time :(int) hours :(int) minutes :(int) seconds}{}
\cl{:(int) millis}{Set the time with milliseconds}
\cm{- (BOOL) date :(int) year :(int) month :(int) day}{}
\cn{Set the date}
\cm{- (BOOL) localTime}{Set with current local time}
\cm{- (BOOL) UTCTime}{Set with current UTC time}
\cm{- (BOOL) norm}{Normalize the date/time}
\cm{- (DText *) toISO8601}{Format to ISO8601}
\cm{- (DText *) toRFC1123}{Format to RFC1123}
\cm{- (DText *) toRFC850}{Format to RFC850}
\cm{- (DText *) toRFC822}{Format to RFC822}
\cm{- (DText *) toASC}{Format as asctime}
\cm{- (DText *) format :(char *) format}{Format as strftime}
\cm{- (DText *) toText}{Convert to text object}
\cm{- (int) fromString :(char **) cstr}{Parse from string}
\cm{- (int) date :(char **) cstr}{Parse date from string}
\cm{- (int) time :(char **) cstr}{Parse time from string}
\cm{- (BOOL) parse :(char **) cstr :(char *) format}{}
\cn{Parse accordingly the format}
\cm{- (BOOL) fromRFC1123 :(char **) cstr}{}
\cn{Parse accordingly RFC1123}
\cm{- (BOOL) fromRFC850 :(char **) cstr}{}
\cn{Parse accordingly RFC850}
\cm{- (BOOL) fromRFC822 :(char **) cstr}{}
\cn{Parse accordingly RFC822}
\cm{- (BOOL) fromASC :(char **) cstr}{Parse from asctime format}
\cm{- (int) compare :(DDateTime *) other}{}
\cn{Compare two date/times}

\sect{DDouble}
\para{Methods}
\cm{- init}{Init to zero double}
\cm{- init :(double) number}{Init to double number}
\cm{- (double) get}{Return the double}
\cm{- set :(double) number}{Set the double number}
\cm{- (int) compare :(DDouble *) other}{Compare to other double}
\cm{- (DText *) toText}{Convert to new text string}
\cm{- (DData *) toData}{Convert to new data string}
\cm{- (int) fromString :(char **) cstr}{Set double from string}

\sect{DFile}
\para{Class methods}
\cm{+ (int) error}{Return the last error (for class methods)}
\cm{+ (BOOL) move :(char *) path :(char *) newPath}{}
\cn{Move/Rename a file}
\cm{+ (BOOL) remove :(char *) path}{Remove a file}
\cm{+ (BOOL) isFile :(char *) path}{Check for file}
\cm{+ (BOOL) isDirectory :(char *) path}{Check for directory}
\cm{+ (long long) size :(char *) path}{Return file size}
\cm{+ (DDateTime *) modified :(char *) path}{}
\cn{Return last modified date/time}
\cm{+ (DDateTime *) accessed :(char *) path}{}
\cn{Return last accessed date/time}
\para{Object methods}
\cm{- init}{Init to empty file object}
\cm{- init :(char *) name :(char *) mode}{Open file}
\cm{- free}{Free the object (close the file)}
\cm{- (int) error}{Return the last error}
\cm{- (int) fileno}{Return file descriptor}
\cm{- (BOOL) isAtty}{Check for terminal}
\cm{- (BOOL) isOpen}{Check for open file}
\cm{- (BOOL) open :(char *) name :(char *) mode}{Open file}
\cm{- (BOOL) isEof}{Check for end-of-file}
\cm{- (char) readChar}{Read a character}
\cm{- (DText *) readLine}{Read a line}
\cm{- (DText *) readText }{Read all text}
\cm{- (DText *) readText :(long) len}{Read len text}
\cm{- (BOOL) seek :(ulong) off :(int) org}{Move position}
\cm{- (BOOL) skip :(ulong) off}{Skip forward} 
\cm{- (unsigned long) tell}{Return current position}
\cm{- (BOOL) writeChar :(char) ch}{Write character}
\cm{- (BOOL) writeLine :(char *) text}{Write line}
\cm{- (BOOL) writeText :(char *) text}{Write text}
\cm{- (uchar) readByte}{Read a byte}
\cm{- (DData *) readData :(ulong) length}{}
\cn{Read a data string}
\cm{- (double) readDouble}{Read a double}
\cm{- (long) readLong}{Read a long}
\cm{- (short) readShort}{Read a short}
\cm{- (BOOL) writeByte :(uchar) byte}{Write a byte}
\cm{- (BOOL) writeData :(uchar *) text :(ulong) length}{}
\cn{Write a data string}
\cm{- (BOOL) writeDouble :(double) nr}{Write a double}
\cm{- (BOOL) writeLong :(long) nr}{Write a long}
\cm{- (BOOL) writeShort :(short) nr}{Write a short}
\cm{- (DList *) readLines}{Read all lines in a list}
\cm{- (BOOL) writeLines :(DList *) list}{Write list to file}
\cm{- (BOOL) flush }{Flush the output buffers}
\cm{- (BOOL) truncate :(long) size }{Truncate file}
\cm{- close}{Close the file}

\sect{DFixedPoint}
\para{Constants}
\cm{DFP\_MAX\_POINT}{Maximum value for point}
\para{Methods}
\cm{- init}{Init to fixed point number (FPN) zero}
\cm{- init :(unsigned) point}{Init fixed point number with point}
\cm{- init :(long) value :(unsigned) point}{Init FPN}
\cm{- (unsigned) point}{Return number of bits for point}
\cm{- point :(unsigned) point}{}
\cn{Change the point, change the precision}
\cm{- set :(long) value}{Set the FPN (using the current point)}
\cm{- set :(long) value :(unsigned) point}{Set the FPN}
\cm{- (long) get}{Return the fixed point number}
\cm{- move :(DFixedPoint *) other}{Set FPN from another object}
\cm{- norm}{Normalize the fixed point number}
\cm{- add :(DFixedPoint *) other}{Add with another FPN}
\cm{- add :(DFixedPoint *) src1 :(DFixedPoint *) src2}{}
\cn{Add two FPNs}
\cm{- sub :(DFixedPoint *) other}{Subtract with another FPN}
\cm{- sub :(DFixedPoint *) src1 :(DFixedPoint *) src2}{}
\cn{Subtract two FPNs}
\cm{- mul :(DFixedPoint *) other}{Multiply with another FPN}
\cm{- mul :(DFixedPoint *) src1 :(DFixedPoint *) src2}{}
\cn{Multiply two FPNs}
\cm{- div :(DFixedPoint *) other}{Divide with another FPN}
\cm{- div :(DFixedPoint *) src1 :(DFixedPoint *) src2}{}
\cn{Divide two FPNs}
\cm{- (DText *) toText}{Convert object to text string}
\cm{- (int) compare :(DFixedPoint *) other}{}
\cn{Compare with another FPN}
\cm{- (double) toDouble}{Convert to a double}

\sect{DFraction}
\para{Class Methods}
\cm{- (int) gcd :(int) a :(int) b}{Greatest Common Divider}
\cm{- (int) lcm :(int) a :(int) b}{Least Common Multiplier}
\para{Object Methods}
\cm{- init}{Init zero fraction}
\cm{- init :(int) num :(int) denom}{Init fraction}
\cm{- (int) denominator}{Return the denominator}
\cm{- denominator :(int) denom}{Set the denominator}
\cm{- (int) numerator}{Return the numerator}
\cm{- numerator :(int) num}{Set the numerator}
\cm{- set :(int) num :(int) denom}{Set the fraction}
\cm{- move :(DFraction *) other}{Set with other fraction}
\cm{- add :(DFraction *) other}{Add fractions}
\cm{- add :(DFraction *) fr1 :(DFraction *) fr2}{}
\cn{Add two fractions}
\cm{- sub :(DFraction *) other}{Subtract fractions}
\cm{- sub :(DFraction *) fr1 :(DFraction *) fr2}{}
\cn{Subract two fractions}
\cm{- mul :(DFraction *) other}{Multiply fractions}
\cm{- mul :(DFraction *) fr1 :(DFraction *) fr2}{}
\cn{Multiply two fractions}
\cm{- div :(DFraction *) other}{Divide fractions}
\cm{- div :(DFraction *) fract :(DFraction *) div}{}
\cn{Divide two fractions}
\cm{- invert}{Invert the fraction}
\cm{- norm}{Normalize the fraction}
\cm{- (DText *) toText}{Convert to (new) DText}
\cm{- (double) toDouble}{Convert to a double}
\cm{- (int) compare :(DFraction *) other}{}
\cn{Compare with another fraction}

\sect{DInt}
\para{Methods}
\cm{- init}{Init to zero int}
\cm{- init :(int) number}{Init to number}
\cm{- (int) get}{Return the int}
\cm{- set :(int) number}{Set the int}
\cm{- (int) compare :(DInt *) other}{Compare to other}
\cm{- (int) fromString :(char **) cstr}{Set int from string}
\cm{- (DText *) toText}{Convert to new text string}
\cm{- (DData *) toData}{Convert to new data string}
\cm{- (int) toBigEndian}{Return int in big endian order}
\cm{- (int) toLittleEndian}{Return int in little endian order}

\sect{DIntArray}
\para{Methods}
\cm{- init}{Init empty int array}
\cm{- init :(const int *) ints :(ulong) length}{Init with array}
\cm{- deepen}{Deepen the copied object}
\cm{- free}{Free the object}
\cm{- (BOOL) isEmpty}{Check if the array is empty}
\cm{- (ulong) length}{Return the length of the array}
\cm{- (const int *) array}{Return the array}
\cm{- size :(ulong) size}{Insure the array size}
\cm{- extra :(unsigned) extra}{Set the extra size during resize}
\cm{- (DText *) toText}{Convert to text string}
\cm{- (int) fromString :(char **) cstr}{Set int from string}
\cm{- clear}{Clear the array}
\cm{- set :(const int *) ints :(ulong) length}{Set with array}
\cm{- put :(long) index :(int) element}{Put element in array}
\cm{- (int) get :(long) index}{Get element from array}
\cm{- insert :(long) index :(int) value}{Insert element in array}
\cm{- delete :(long) index}{Delete element from array}
\cm{- insert :(long) from :(long) to :(const int *) ints}{}
\cl{:(ulong) length}{Insert array in part of array}
\cm{- (DIntArray *) get :(long) from :(long) to}{}
\cn{Return sub array}
\cm{- delete :(long) from :(long) to}{Delete range in array}
\cm{- append :(const int *) ints :(ulong) length}{}
\cn{Append an array}
\cm{- prepend :(const int *) ints :(ulong) length}{}
\cn{Prepend an array}
\cm{- push :(int) value}{Push element at end of array}
\cm{- (unsigned char) pop}{Pop element at end of array}
\cm{- (int) tos}{Return element at end of array}
\cm{- (BOOL) enqueue :(int) value}{Put element at start of array}
\cm{- (int) dequeue}{Pop element at end of array}
\cm{- (int) compare :(DIntArray *) other}{}
\cn{Compare with another array object}
\cm{- (int) bcompare :(const int *) ints :(ulong) length}{}
\cn{Compare with an array}
\cm{- (ulong) count :(int) search :(long) from :(long) to}{}
\cn{Count search in array}
\cm{- (long) index :(int) search :(long) from :(long) to}{}
\cn{Find smallest index for search}
\cm{- (long) rindex :(int) search :(long) from :(long) to}{}
\cn{Find biggest index for seach}
\cm{- (long) sum :(long) from :(long) to}{Calculate sum}
\cm{- (int) max :(long) from :(long) to}{Determine max element}
\cm{- (int) min :(long) from :(long) to}{Determine min element}
\cm{- (double) average :(long) from :(long) to}{}
\cn{Calculate average}
\cm{- (double) variance :(long) from :(long) to}{}
\cn{Calculate variance}
\cm{- (double) standardDeviation :(long) from :(long) to}{}
\cn{Calculate standard deviation}
\cm{- sort :(long) from :(long) to}{Sort the array (low to high)}
\cm{- invert :(long) from :(long) to}{Invert (mirror) the array}

\sect{DLong}
\para{Methods}
\cm{- init}{Init to zero long}
\cm{- init :(long) number}{Init to number}
\cm{- (long) get}{Return the long number}
\cm{- set :(long) number}{Set the long number}
\cm{- (long) compare :(DLong *) other}{Compare to other object}
\cm{- (int) fromString :(char **) cstr}{Set long from string}
\cm{- (DText *) toText}{Convert to new text string}
\cm{- (DData *) toData}{Convert to new data string}
\cm{- (long) toBigEndian}{Return long in big endian order}
\cm{- (long) toLittleEndian}{Return long in little endian order}

\sect{DLRnd}
\para{Methods}
\cm{- init}{Init non-seed random generator}
\cm{- init :(ulong) seed}{Init seeded random generator}
\cm{- seed :(ulong) seed}{Set the seed for generator}
\cm{- (double) nextDouble}{Generate a random double}
\cm{- (double) nextDouble :(double) from :(double) to}{}
\cn{Generate a ranged random double}
\cm{- (int) nextInt}{Generate a random integer}
\cm{- (int) nextInt :(int) from :(int) to}{}
\cn{Generate a ranged random integer}
\cm{- (long) nextLong}{Generate a random long}
\cm{- (long) nextLong :(long) from :(long) to}{}
\cn{Generate a ranged random long}

\sect{DRnd}
\para{Methods}
\cm{- init}{Init non-seed random generator}
\cm{- init :(ulong) seed}{Init seeded random generator}
\cm{- seed :(ulong) seed}{Set the seed for generator}
\cm{- (double) nextDouble}{Generate a random double}
\cm{- (double) nextDouble :(double) from :(double) to}{}
\cn{Generate a ranged random double}
\cm{- (int) nextInt}{Generate a random integer}
\cm{- (int) nextInt :(int) from :(int) to}{}
\cn{Generate a ranged random integer}
\cm{- (long) nextLong}{Generate a random long}
\cm{- (long) nextLong :(long) from :(long) to}{}
\cn{Generate a ranged random long}

\sect{DScore}
\para{Methods}
\cm{- init}{Init non-ranged score}
\cm{- init :(double) min :(double) max}{Init ranged score}
\cm{- init :(int) value}{Init discrete score}
\cm{- (double) min}{Return the minimum range value}
\cm{- (double) max}{Return the maximum range value}
\cm{- (int) length}{Return the number of values in score}
\cm{- (double) sum}{Return the sum of the values}
\cm{- (double) sumSquared}{Return the squared sum}
\cm{- (double) percentage}{Return percentage in distribution}
\cm{- (BOOL) range :(double) min :(double) max}{}
\cn{Set the range for the score}
\cm{- (BOOL) range :(int) value}{}
\cn{Set the discrete range for the score}
\cm{- (void) reset}{Reset the length and sums}
\cm{- distribution :(int) length}{}
\cn{Set number values in distribution}
\cm{- (BOOL) update :(double) value}{Feed a value in the score}
\cm{- (double) mean}{Calculate the mean of the values}
\cm{- (double) average}{Calculate the average of the values}
\cm{- (double) variance}{Calculate the variance of the values}
\cm{- (double) standardDeviation}{Calculate the SD of the values}

\sect{DShort}
\para{Methods}
\cm{- init}{Init to zero short}
\cm{- init :(short) number}{Init to number}
\cm{- (short) get}{Return the short}
\cm{- set :(short) number}{Set the short to number}
\cm{- (int) compare :(DShort *) other}{Compare with other}
\cm{- (int) fromString :(char **) cstr}{Set short from string}
\cm{- (DText *) toText}{Convert to new text string}
\cm{- (DData *) toData}{Convert to new data string}
\cm{- (short) toBigEndian}{Return short in big endian order}
\cm{- (short) toLittleEndian}{Return short in little endian order}

\sect{DText}
\para{Methods}
\cm{- init}{Init an empty string}
\cm{- init :(char *) cstr}{Init with c-string}
\cm{- copy}{Copy a text string}
\cm{- free}{Free a text string}
\cm{- size :(ulong) size}{Insure the length of string}
\cm{- extra :(unsigned) extra}{Extra space during resizing}
\cm{- (int) error}{Return the last error}
\cm{- (double) toDouble}{Convert string to double}
\cm{- (int) toInt}{Convert string to int}
\cm{- (long) toLong}{Convert string to long}
\cm{- format :(char *) fmt,...}{Set the string with format}
\cm{- clear}{Clear the text string}
\cm{- set :(char *) cstr}{Set the string with c-string}
\cm{- set :(char *) cstr :(long) from :(long) to}{}
\cn{Set the string with c-substring}
\cm{- set :(char) ch :(long) nr}{Set number of characters}
\cm{- put :(long) index :(char) ch}{Set character in string}
\cm{- (char) get :(long) index}{Get character from string}
\cm{- delete :(long) index}{Remove character from string}
\cm{- insert :(long) from :(long) to :(char *) cstr}{}
\cn{Insert c-substring in text string}
\cm{- insert :(long) from :(long) to :(char)ch :(long)nr}{}
\cn{Insert number of characters in text string}
\cm{- (DText *) get :(long) from :(long) to}{}
\cn{Return new substring from string}
\cm{- delete :(long) from :(long) to}{}
\cn{Delete substring from string}
\cm{- (BOOL) isEmpty}{Test for empty string}
\cm{- (ulong) length}{Return the length of the string}
\cm{- (char *) cstring}{Return the c-string from the string}
\cm{- (DText *) toText}{Convert string to new DText object}
\cm{- (DData *) toData}{Convert string to new DData object}
\cm{- (DText *) readText}{Read all text from string}
\cm{- (DText *) readText :(long) lenght}{}
\cn{Read length text from string}
\cm{- (DText *) readLine}{Read text till EOL from string}
\cm{- (char) readChar}{Read character from string}
\cm{- (ulong) tell}{Return current position in string}
\cm{- (BOOL) seek :(ulong) off :(int) origin}{}
\cn{Move position in string}
\cm{- (BOOL) skip :(ulong) off}{Skip positions in string}
\cm{- (BOOL) isEof}{Test for end position in string}
\cm{- (DText *) scanText :(char) sep}{Scan text until separator}
\cm{- (BOOL) cmatch :(char *) cstr}{Match with string, case sens.}
\cm{- (BOOL) imatch :(char *) cstr}{Match with string, case insens.}
\cm{- (int) scanInt :(int) wrong}{Scan text for int}
\cm{- (int) skipChar :(char) ch}{Skip character}
\cm{- (int) skipWhiteSpace}{Skip whitespace}
\cm{- (BOOL) writeText :(char *) text}{Write text to string}
\cm{- (BOOL) writeLine :(char *) text}{Write line to string}
\cm{- (BOOL) writeChar :(char) ch}{Write character to string}
\cm{- append :(char *)cstr}{Append c-string to string}
\cm{- prepend :(char *) cstr}{Prepend c-string to string}
\cm{- push :(char) ch}{Push a character to string}
\cm{- pop :(char) ch}{Pop a character from string}
\cm{- multiply :(unsigned) times}{Repeat the string in the string}
\cm{- capitalize}{Capitalize the string}
\cm{- capwords}{Capitalize the words in the string}
\cm{- expandtabs :(unsigned) size}{Expand the tabs to spaces}
\cm{- lower}{Lowercase characters in string}
\cm{- upper}{Uppercase characters in string}
\cm{- swapcase}{Change case characters in string}
\cm{- lstrip}{Remove leading spaces in string}
\cm{- rstrip}{Remove trailing spaces in string}
\cm{- strip}{Remove leading and trailing spaces}
\cm{- ljust :(unsigned) width}{Left justify string}
\cm{- rjust :(unsigned) width}{Right justify string}
\cm{- center :(unsigned) width}{Center string}
\cm{- column :(int) width}{Put string in column}
\cm{- zfill :(unsigned) width}{Left justify string with zero's}
\cm{- (int) fromString :(char **) cstr}{Set string from c-string}
\cm{- (int) compare :(DText *) obj}{Compare string with obj}
\cm{- (int) ccompare :(char *) cstr}{}
\cn{Compare string with c-string case sensitive}
\cm{- (int) icompare :(char *) cstr}{}
\cn{Compare string with c-string case insensitive}
\cm{- (int) ccompare :(char *) cstr :(ulong) len}{}
\cn{Compare string with first len chars in c-string case sensitive}
\cm{- (int) icompare :(char *) cstr :(ulong) len}{}
\cn{Compare string with first len chars in c-string case insensitive}
\cm{- (ulong) count :(char *) cstr :(long) from :(long) to}{}
\cn{Count occurences in string}
\cm{- (long) index :(char *) cstr :(long) from :(long) to}{}
\cn{Find first index for c-string}
\cm{- (long) rindex :(char *) cstr :(long) from :(long) to}{}
\cn{Find last index for c-string}
\cm{- replace :(char *) old :(char *) new :(long) max}{}
\cn{Replaces old with new in string, max times}

% Footer
\vfill \hrule\smallskip
{\smallrm Version 0.6.0. This card may be freely distributed under 
the terms of the GNU general public licence\par
Copyright \copyright\ {\oldstyle 2003-2005} by Dick van Oudheusden}

% Ending
\supereject
\if L\lr \else\null\vfill\eject\fi
\if L\lr \else\null\vfill\eject\fi
\bye

% EOF
